package org.fqh.email;

import java.util.ArrayList;
import java.util.List;

import org.fqh.utils.EmailUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;


/**
* @author fqh 
* @version 创建时间：2017年10月18日 下午5:19:38
* 类说明
*/
@RunWith(value = SpringJUnit4ClassRunner.class)
@ContextConfiguration(value = "classpath*:spring/spring-email.xml")
public class EmailTest {  
    private static final Logger log = LoggerFactory.getLogger(EmailTest.class);  
      
    @Autowired  
    private EmailUtil mailUtil;  
      
    @Test  
    public void sendSingleTest(){  
        log.info("sendSingleTest");  
          mailUtil.send("729855417@qq.com", "This is a test single mail", "Hello Single!");  
    }  
      
   // @Test  
    public void sendMassTest(){  
        log.info("sendMassTest");  
        List<String> recipients=new ArrayList<String>();    
        recipients.add("729855417@qq.com");  
        mailUtil.send(recipients, "This is a test mass mail", "Hello Mass!");  
    }  
}  